#ifndef  _LOG_H_
#define  _LOG_H_

#include "../define/define.h"
#include "lock.h"

#define  MAX_PATH  255

void GetExePath(char* buf);

class TraceFile
{
public:
	TraceFile();
	~TraceFile();

	void   WriteTrace(char* level_name,const char* str);
	void   Flush();

	char*  GetLogFile();
	
private:
   
	char        m_szlog_dir[MAX_PATH];
	char        m_szlog_file[MAX_PATH];

	uint32      m_process;
	ofstream    m_fslog;
};

class logfile 
{
public:
	logfile(char* levelname);
	~logfile();

    void WriteTrace(const char* str);

private:
	
	char m_levelname[32];
};

#endif
